<!DOCTYPE html>
<html lang="en">

<head>
    <title>THREE.js tutorial - step 3</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
    <style>
        body {
            margin: 0;
        }


        label {
            margin: 8px;
            width: 30%;
            height: 30%;
            /* display: block; */
            position: relative;
            cursor: pointer;
            margin-bottom: 30px;
        }

        input[type=radio] {
            display: none;
        }

        input[type=radio]+img {
            border: 4px solid #eee;
            transition: border-color 0.2s ease-in-out;
            max-height: 200px;
        }

        input[type=radio]:checked+img {
            border-color: #4286f4;
        }

        label:hover input[type=radio]+img {
            filter: brightness(90%);
        }

        label img {
            border-radius: 20px;
            /* transform: skew(-10deg);

                -webkit-transform: skew(-10deg);

                -moz-transform: skew(-10deg);

                -o-transform: skew(-10deg);

                -ms-transform: skew(-10deg); */
            width: 20%;
            height: 10%;
            /* display: block; */
            max-height: 200px;
        }

        .group2 label img {
            border-radius: 20px;
            transform: skew(-20deg);

            -webkit-transform: skew(-30deg);

            -moz-transform: skew(-30deg);

            -o-transform: skew(-30deg);

            -ms-transform: skew(-30deg);
            width: 20%;
            height: 10%;
            /* display: block; */
            max-height: 200px;
        }

        label span {
            position: absolute;
            /* bottom: -24px; */
            left: 0;
            right: 0;
            text-align: center;
            font-size: 10px;
            font-weight: bold;
        }

        .lu-btn-3d {
            width: 100px;
            height: 40px;
            background: linear-gradient(to bottom, #4eb5e5 0%, #389ed5 100%);
            border: none;
            border-radius: 5px;
            position: relative;
            border-bottom: 5px solid #2b8bc6;
            color: #fbfbfb;
            font-weight: 600;
            font-family: 'Open Sans', sans-serif;
            text-shadow: 1px 1px 1px rgba(0, 0, 0, .4);
            font-size: 15px;
            text-align: center;
            box-shadow: 0px 3px 0px rgba(0, 0, 0, .2);
            cursor: pointer;
        }

        .lu-btn-3d:active {
            box-shadow: 0px 2px 0px rgba(0, 0, 0, .2);
            top: 1px;
        }

        .chat::-webkit-scrollbar {
            display: none;
        }

        .chat {
            -ms-overflow-style: none;
            /* IE and Edge */
            scrollbar-width: none;
            /* Firefox */
        }

        .talk_sub:active {
            box-shadow: 0px 2px 0px rgba(0, 0, 0, .2);
            top: 2px;
        }

        .three-d {
            color: #fff;
            background-color: #f1c40f;
            text-shadow: -2px 2px 2px rgb(209 132 0),
                -2px 2px 2px rgb(209 132 0),
                -2px 2px 2px rgb(209 132 0),
                -2px 2px 2px rgb(209 132 0),
                -2px 2px 2px rgb(209 132 0),
                -2px 2px 2px rgb(209 132 0);
            box-shadow: 0px 15px 0px 0px #f39c12;
            transition: all .5s;
        }

        .three-d:hover {
            background-color: #fcdc5e;
        }

        .three-d:active {
            transform: translate(0, 4px);
            box-shadow: 0px 1px 0px 0px #f39c12;
        }


        .talk_con:hover {
            box-shadow: 0 16px 32px 0 rgba(48, 55, 66, 0.15);
            transform: translate(0, -5px);
            transition-delay: 0s !important;
        }

        #talk {
            background: linear-gradient(45deg, #04e6fb, #65ff9a);
            clip-path: polygon(0 0,
                    30px 50%,
                    0 100%,
                    calc(100% - 30px) 100%,
                    100% 50%,
                    calc(100% - 30px) 0);
        }
    </style>
</head>

<body style="color:#fbfbfb">
    <script src="libs/three.min.js"></script>
    <script src="libs/inflate.min.js"></script>
    <script src="libs/FBXLoader.js"></script>
    <script src="libs/OrbitControls.js"></script>
    <script src="libs/Detector.js"></script>
    <script src="index1.js"></script>
    <script src="http://code.jquery.com/jquery-latest.js"></script>
    <script src="/socket.io/socket.io.js"></script>
    <script src="https://code.jquery.com/jquery-1.11.1.js"></script>
    <script>


        document.addEventListener("DOMContentLoaded", function () {
            const game = new Game1();
            window.game = game;//For debugging only
        });

        $(function () {
            var socket = io();
            $('#talksub').click(function () {
                // var showContent = document.getElementById('chat');
                // showContent.scrollTop = showContent.scrollHeight;

                if ($('#talkwords').val() == '') {
                    return;
                }
                socket.emit('chat message in hall', sessionStorage.getItem("username") + ': ' + $('#talkwords').val());
                $('#talkwords').val('');
                
                return false;
            });
            socket.on('chat message in hall', function (msg) {
                $('.chat').append($('<p>').text(msg));
                var showContent = document.getElementById('chat');
                showContent.scrollTop = showContent.scrollHeight;
            });
        });

    </script>

    <!-- 大厅聊天区 -->
    <div class="talk_con" id="talk_con_id" style="position: absolute;top:50%;left:5%;border-radius: 10px;
    width: 23%;
    padding: 10px;
    box-shadow: 1px 1px 10px rgba(0, 0, 0, 0.2);
    background-color: rgba(45, 45, 60, 0.5);">
        <label>大厅聊天区</label>
        <div id="chat" class="chat" style="width: 100%;;height:270px;overflow: auto;">
        </div>
        <div class="talk_input" id="talk_input_id">
            <input type="text" class="talk_word" id="talkwords" onkeypress="InputPress()" style="height: 30px;">
            <input type="button" value="发送" class="talk_sub" id="talksub" style="
                width: 100px;
                height: 40px;
                background: linear-gradient(to bottom, #4eb5e5 0%, #389ed5 100%);
                border: none;
                border-radius: 5px;
                position: relative;
                border-bottom: 5px solid #2b8bc6;
                color: #fbfbfb;
                font-weight: 600;
                font-family: 'Open Sans', sans-serif;
                text-shadow: 1px 1px 1px rgba(0, 0, 0, .4);
                font-size: 15px;
                text-align: center;
                box-shadow: 0px 3px 0px rgba(0, 0, 0, .2);
                cursor: pointer;
">
        </div>

    </div>

    <!-- <button style="position:absolute;top:80%;left:50%" onClick="javascript:game.toggleAnimation()">Change Animation</button> -->

    <input type="button" value="切换动作" id="talk" class="three-d" onClick="javascript:game.toggleAnimation()" style="
    position:absolute;top:90%;left:44%;
        width: 200px;
        height: 40px;
        /* background: linear-gradient(to bottom, #4eb5e5 0%, #389ed5 100%); */
        border: none;
        border-radius: 10px;
        /* border-bottom: 5px solid #2b8bc6; */
        color: #fbfbfb;
        font-weight: 600;
        font-family: 'Open Sans', sans-serif;
        text-shadow: 1px 1px 1px rgba(0, 0, 0, .4);
        font-size: 15px;
        text-align: center;
        box-shadow: 0px 3px 0px rgba(0, 0, 0, .2);
        cursor: pointer;
    ">

</body>

</html>